All Questions
Tagged with functional-programmingparsing
22 questions
4votes
7answers
279views
Breaking a string expression in operator and operands
Requesting for a code review for a scala implementation. Problem Given an expression string made of numbers and operators +,-,/,* , break it in a list of Integer or ...
2votes
1answer
201views
Commented Parser Combinators in Lisp-style C
I've attempted to remedy the issues outlined in the answer to my previous question. I've added several hundred blank lines to better illustrate the grouping of functions and generally make things look ...
2votes
1answer
156views
Parser Combinators in C redux
A few more rewrites down the line from my previous question, this is the C version 11 based on the PostScript prototype version 12. The PostScript version is shorter, but it's some crazy ass ...
4votes
1answer
872views
Haskell: implementing Read for a custom dynamic value type
I'm using Haskell to interpret a dynamically-typed language. I have a sum type called Value which can represent some basic objects: ...
5votes
1answer
180views
Small combinator parsing library in Haskell
I recently wrote code to parse lambda expressions written in a lisp like format, using a small hand-rolled parsing library. The goal This code was written as a part of this code-golf challenge not as ...
2votes
1answer
2kviews
Simple Haskell Parser
I'm very new to haskell (I never used Monads, Functors and other things) and FP in general. I decided to write the simplest parser I possibly can with some expansion possibilities. (I have a general ...
2votes
1answer
105views
Extract values from English numerals, e.g. "nine million and one"
Though many have done it the other way around, I have not seen such code in many places. And, to be honest, I don't know why this cluster of if-statements, ...
2votes
1answer
239views
JSON Parser, pulls data from a JSON file for analysis
This is the first time I have programmed something that I will actually personally use, so I am happy about that. I tried to write good code whilst applying functional programming concepts. So no ...
10votes
1answer
528views
Lazy, Functional Parser Combinators
Parser Combinators are the amazingly elegant way to write parsers that has evolved over on the functional programming side of the world, but have been less available or accessible for imperative ...
2votes
0answers
299views
A simple tokenizer in Erlang
I'm trying to learn Functional Programming and I picked Erlang because I will have to use it eventually. In the meantime, I'm trying to build a simple lexer to stumble upon problems and solve them ...
5votes
1answer
351views
Collecting YouTube links from a page
I wrote code for my needs (i.e. collecting YouTube links from a page) and it is simple, but now I just want to know what can I do just to make it a better and properly written one. For example, I ...
5votes
1answer
592views
Quadratic Equation Solver v2.0 in Javascript using Functional Programming
I have posted this in continuation to my earlier post Quadratic equation solver in JavaScript. Tried to improve on the shortcomings last time and also changed the logic. It is still not covering all ...
2votes
0answers
533views
nom Parser in Rust
I'm attempting to make a parser using nom in Rust. Nom implements parser combinators, so more complex parsers are built from simpler parsers. Because of this, I've started with a simple ID token ...
2votes
1answer
314views
Parser Combinators in OO C
In trying to understand and use the Parser Combinator concept, I've coded up as close an analogue as I could manage within the constraints of the C language. C doesn't have first-class functions or ...
1vote
2answers
77views
Functional method for storing a query string as a simple key-value object
I'm working on an isomorphic javascript module (query-hash) to handle query strings and base64 tokens. It's essentially a simple key-value object with methods for taking in data and giving it back in ...